package reflect;

import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMenthod;

import java.lang.reflect.Method;

public class ReflectDemo8 {
    public static void main(String[] args) throws Exception {
        Class cls  = Class.forName("reflect.person");
        Method method  = cls.getDeclaredMethod("sayHello");
        if (method.isAnnotationPresent(AutoRunClass.class)){
            AutoRunMenthod arm = method.getAnnotation(AutoRunMenthod.class);
            int value = arm.value();
            System.out.println("参数value的值为："+value);
        }
    }
}
